<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../node_modules/react/umd/react.development.js"></script>
    <script src="../node_modules/react-dom/umd/react-dom.development.js"></script>
    <script src="../node_modules/babel-standalone/babel.min.js"></script>
</head>

<body>
    <div id="root"></div>
    <script type="text/babel">

        class MyCom extends React.Component {
            constructor(props) {
                super(props)//this.props = props
                console.log("constructor,props=", props);
            }

            render() {
                return <div>我是{this.props.name},芳龄{this.props.age}</div>
            }
        }

        const son = {
            name: "嬴政",
            age: -1
        }


        function Daddy(props) {
            return (
                <div>
                    <h1>劳资是{props.name},芳龄{props.age}</h1>
                    <MyCom {...son} />
                </div>
            )
        }

        ReactDOM.render(<Daddy {...{ name: "嬴子楚", age: -123 }} />, document.querySelector("#root"))

    </script>
</body>

</html>